package com.practice.controller.admin;


import com.practice.common.result.Result;
import com.practice.pojo.admin.dto.AdvposDTO;
import com.practice.pojo.admin.dto.AdvposPageDTO;
import com.practice.service.admin.AdvposService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author itcast
 * @since 2023-05-15
 */
@RestController
@RequestMapping("/ydd_advpos")
public class AdvposController {


    @Autowired
    private AdvposService advposService;


    //广告位列表-分页查询
    @GetMapping("/list")
    public Result page(AdvposPageDTO advposPageDTO){
        Result result = advposService.pageList(advposPageDTO);
        return result;
    }


    //广告位修改
    @PostMapping("/update")
    public Result advposUpdate(@RequestBody AdvposDTO advposDTO){
        return advposService.advposUpdate(advposDTO);
    }


    //广告位删除
    @GetMapping("/del")
    public Result advposDelete(Integer id){
        return advposService.advposDelete(id);
    }


    //广告位列表-全部
    @GetMapping("/all")
    public Result advposAll(){
        return advposService.advposAll();
    }


    //广告位详情
    @GetMapping("/rowInfo")
    public Result advposDetail(Integer id){
        return advposService.advposDetail(id);
    }


    //广告位添加
    @PostMapping("/add")
    public Result advposAdd(@RequestBody AdvposDTO advposDTO){
        return advposService.advposAdd(advposDTO);
    }



}
